include io.asm

stack segment stack
	dw 128 dup (?)
stack ends

;;======================================================================
data segment
	Head db "Vasilenko Anatoly. Group 111.$"
	Input db "Enter please number: $"
	Output db "Answer: $"
data ends
;;======================================================================

code segment 'code'
	assume ss:stack, ds:data, cs:code
start:
	mov ax,data
	mov ds,ax
	lea dx, Head
	outstr
	newline
	newline
	;;------------------------------------------------------------------
		lea dx, Input;
		outstr;
		
		mov ah, 0;
		mov bh, 0;
		inch al; answer
		sub ax, '0';
		
		L:	inch bl; sign
			cmp bl, '.';
			je answer;
			inch cl; number
			sub cl, '0';
			
			cmp bl, '+';
			jne minus;
				add ax, cx;
				jmp L;
			minus:
				sub ax, cx;
		jmp L;
			
	answer:
		lea dx, Output;
		outstr;
		outint ax;
	;;------------------------------------------------------------------

the_end:
	newline;
	newline;
	mov ah,8
	int 21h
    finish
code ends

;;======================================================================
end start 

;;======================================================================
